/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ventanaPrincipal.java
 *
 * Created on 20/01/2012, 11:24:59 AM
 */
package vista;

import controlador.ControladorGeneral;
import controlador.ControladorVentana;

/**
 *
 * @author Jesús Vásquez
 */
public class VentanaRegistroBebe extends javax.swing.JFrame {

    ControladorVentana controladorVentana;
    ControladorGeneral controlador;
    /** Creates new form ventanaPrincipal */
    public VentanaRegistroBebe() {
        initComponents();
        controladorVentana = new ControladorVentana();
        controlador = new ControladorGeneral();
        controlador.leerArchivo();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLayeredPane1 = new javax.swing.JLayeredPane();
        jLabel1 = new javax.swing.JLabel();
        botonCancelar = new javax.swing.JButton();
        botonRegistrar = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        textoCedula = new javax.swing.JTextField();
        textoNombre = new javax.swing.JTextField();
        textoApellido = new javax.swing.JTextField();
        fechaNacimiento = new com.standbysoft.component.date.swing.JDatePicker();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Consultorio - Registrar bebé");
        jLabel1.setBounds(0, 30, 600, 30);
        jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        botonCancelar.setFont(new java.awt.Font("Tahoma", 0, 14));
        botonCancelar.setText("Cancelar");
        botonCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonCancelarActionPerformed(evt);
            }
        });
        botonCancelar.setBounds(470, 340, 100, 30);
        jLayeredPane1.add(botonCancelar, javax.swing.JLayeredPane.DEFAULT_LAYER);

        botonRegistrar.setFont(new java.awt.Font("Tahoma", 0, 14));
        botonRegistrar.setText("Registrar");
        botonRegistrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonRegistrarActionPerformed(evt);
            }
        });
        botonRegistrar.setBounds(470, 300, 100, 30);
        jLayeredPane1.add(botonRegistrar, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel2.setText("Cedula del padre/madre:");
        jLabel2.setBounds(40, 230, 160, 20);
        jLayeredPane1.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel3.setText("Nombre:");
        jLabel3.setBounds(40, 110, 140, 20);
        jLayeredPane1.add(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel4.setText("Apellido:");
        jLabel4.setBounds(40, 150, 140, 20);
        jLayeredPane1.add(jLabel4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel5.setText("Fecha de nacimiento:");
        jLabel5.setBounds(40, 190, 140, 20);
        jLayeredPane1.add(jLabel5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        textoCedula.setFont(new java.awt.Font("Tahoma", 0, 12));
        textoCedula.setBounds(210, 230, 150, 20);
        jLayeredPane1.add(textoCedula, javax.swing.JLayeredPane.DEFAULT_LAYER);

        textoNombre.setFont(new java.awt.Font("Tahoma", 0, 12));
        textoNombre.setBounds(210, 110, 150, 20);
        jLayeredPane1.add(textoNombre, javax.swing.JLayeredPane.DEFAULT_LAYER);

        textoApellido.setFont(new java.awt.Font("Tahoma", 0, 12));
        textoApellido.setBounds(210, 150, 150, 20);
        jLayeredPane1.add(textoApellido, javax.swing.JLayeredPane.DEFAULT_LAYER);
        fechaNacimiento.setBounds(210, 190, 89, 22);
        jLayeredPane1.add(fechaNacimiento, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 600, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void botonCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonCancelarActionPerformed
        controladorVentana.ventanaPrincipal(this);
    }//GEN-LAST:event_botonCancelarActionPerformed

    private void botonRegistrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonRegistrarActionPerformed
        controlador.registrarBebe(textoNombre, textoApellido, textoCedula, fechaNacimiento);
    }//GEN-LAST:event_botonRegistrarActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonCancelar;
    private javax.swing.JButton botonRegistrar;
    private com.standbysoft.component.date.swing.JDatePicker fechaNacimiento;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JTextField textoApellido;
    private javax.swing.JTextField textoCedula;
    private javax.swing.JTextField textoNombre;
    // End of variables declaration//GEN-END:variables
}
